package cn.magic.controller;

import cn.magic.ajax.AjaxResult;
import cn.magic.domain.Store;
import cn.magic.service.impl.StoreServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class StoreController {
    @Autowired
    private StoreServiceImpl storeService;

    @PostMapping("/store/add")
    public AjaxResult add (@RequestBody Store store){
        try {
            storeService.add(store);
            return AjaxResult.me();
        } catch (Exception e){
            e.printStackTrace();
            return AjaxResult.me().setSuccess(false).setMessage("系统繁忙");
        }
    }



}
